function getStyle(obj,name){
	if(window.getComputedStyle){
		return getComputedStyle(obj,null)[name];
	}else{
		return obj.currentStyle[name];
	}
}
function move(obj,name,target,speed,callback){
	/*
	 * 	清除上一个定时器
	 */
	clearInterval(obj.timer);
	//获取目前位置，设置速度
	
	var current = parseInt(getStyle(obj,name));
	
//	console.log(current);
	if(current > target){
		speed = -speed;
	}
	//设置定时器修改name值
	obj.timer = setInterval(function(){
		var oldValue = parseInt(getStyle(obj,name));
		//设置新值
		var newValue = oldValue + speed;
		//判断是否已经到达
		if(speed > 0 && target < newValue || speed < 0 && target >= newValue){
			newValue = target;
		}
		//修改值
		obj.style[name] = newValue + "px";
		//是否到达
		if(newValue == target){
			//取消定时器
//			clearinterval(obj.timer);
			clearInterval(obj.timer);
			callback&&callback();
		}
	},30);
}
function moveOpa(opacityNum,timeNum){
	setTimeout(function(){
		var all = document.getElementById("all");
		all.style.opacity = opacityNum;
		all.style.transition =timeNum +"s linear";
	},0);
};
